import os
import yaml
from config import BASE_PATH

# 定义一个函数
def read_yaml(filename):
    fil_path = BASE_PATH + os.sep + "data" + os.sep + filename
    # fil_path = os.sep+filename
    # 定义空列表，组装测试数据
    arr = []
    # 获取文件流
    with open(fil_path, 'r', encoding='utf-8') as f:
        # 遍历  调用yaml.safe_load(f).values()方法，来进行遍历
        for datas in yaml.safe_load(f).values():
            arr.append(tuple(datas.values()))  # list()  tuple()        类型转换
    # 返回 结果
    return arr

if __name__ == '__main__':
    print(read_yaml("skyeye_login.yaml"))


